Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid node.parentNode in style manager #1576

Merged
merged 1 commit into from
Sep 21, 2021
Merged

Avoid node.parentNode in style manager #1576

merged 1 commit into from
Sep 21, 2021

Conversation

TrySound
Copy link
Member

node.parentNode will be removed in v3 along with JSAPI class wrapper on
each node.

Style manager uses it to find inherited styles. To workaround this
I collected all parents along with all styles. This constraints style
manager to work only with initial ast which should not be a problem as
each plagin execution is isolated.

Also covered style manager tests with tsdoc.
Better review with hidden whitespaces.

node.parentNode will be removed in v3 along with JSAPI class wrapper on
each node.

Style manager uses it to find inherited styles. To workaround this
I collected all parents along with all styles. This constraints style
manager to work only with initial ast which should not be a problem as
each plagin execution is isolated.
Copy link
Collaborator

@renatorib renatorib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the simplicity of Map for these things

Copy link
Collaborator

@omgovich omgovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better without parent.parentNode 👍

@TrySound TrySound merged commit 79ceb09 into master Sep 21, 2021
@TrySound TrySound deleted the style-orphans branch September 21, 2021 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants